<?php
require_once "../Common/database.php";
require_once "../Common/values.php";
require_once "../js/formsubmit.php";
require_once '../Helpdesk/theme.php';

$duedate = date("y-m-d");
$duedate = strtotime(date("y-m-d", strtotime($duedate)) . " +5 days");
$duedate = date("y-m-d",$duedate);
list($year, $month, $day) = preg_split('[-]', $duedate);

if($publiclock=='true')
{
echo '<center><H1>SYSTEM lOCKED!! '.$lockedreason.'</CENTER></H1>';
exit;
}
$result = mysql_query("SELECT * FROM tblbranches WHERE BranchName='$_POST[branch]'");
while($row = mysql_fetch_array($result))
{
$_POST[branch]=$row[BranchNumber];
}



echo '<h3>New Job</h3>';

#echo '<table><tr>';
if ($ldap=='true')
{
echo '<table><tr><form method="Post" Action="ldapsearch.php?f=publicnew"><td class="noborder">Last Name : <input type=text name=lastname></td><td class="noborder"><INPUT type="image" src="../img/go.gif"></td></tr></form>';
}
echo '<form method="Post" Action=../helpdesk/publicinsert.php name="jobForm">';
echo '<table Border=1 width=100%><tr>';
echo '<td>Log : '.'<INPUT type="hidden" name="log">';echo 'New'.'</td>';
echo '<td>Operator :<INPUT type="hidden" name="operator" value="Public"> Public<p> </td>' ;
echo '<td>Date : <INPUT type="hidden" name="date" value='.$date.'>'.$date.'</td>';
echo '<td> Time : <INPUT type="hidden" name="time" value='.$time.'>'.$time.'</td>';

echo '<tr><td>Requestor : <p><INPUT TYPE="Text" Size="30" name="requestor" value="'.$_POST['requestor'].'"></td>';
echo '<td>Email updates to: <br> <Input Type="text" name="mailupdates" value="'.$_POST[mail].'" size="30">';
echo '<tr><td> Branch No : <p> <Select name="branch"><option>'.$_POST['branch'].'</option>';
genBranches();
echo '</select></td><td>Department:<p><INPUT type="text" name="department" value="'.$_POST['department'].'"></td>  <td> Phone: <p><INPUT type="text" name="phone" value="'.$_POST['phone'].'"></td><td>  VNC :<p> <INPUT type="text" name="vnc" size="15" maxlength="15" value='.$row['VNC'].'></td></tr>';
echo '<tr><td>Due date : <p><INPUT type="text" name="dueday" size="2" value="'.$day.'">/<INPUT type="text" name="duemonth" size="2" value="'.$month.'">/<INPUT type="text"  size="2"name="dueyear" value=10></td>';
echo ' <td>Proirty:<p> <SELECT name="proirty" Disabled>
    <option>Medium</option></SELECT></td>';
echo '<td>Status :<p> <SELECT name="status" Disabled>
    <option>Pending</option></SELECT> </TD><td></td></TR>';
echo '<tr><td colspan=4>Subject: <INPUT TYPE="Text" name="subject" size="80"></td></tr>';
echo '<tr><td colspan=4>Problem : <br><textarea rows=5 cols=100 name="problem" value='.$row['Subject'].'>'.$row['Problem'].'</textarea></td></tr></table>';


echo '<p><img src="../img/submit.gif" name="submitbutton" onClick="formControl();">';


?>

